package com.paper.tiger.easy.rpc.s.client.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * [简要描述]:
 * [详细描述]:
 *
 * @author ZouHaiBo
 * @version 1.0, 2021/6/22 16:28
 * @since JDK 1.8
 */
@ConfigurationProperties(prefix = "netty.rpc")
@Configuration
public class Config
{

    /**注册中心ip*/
    private String registyCenterHost;

    /**注册中心端口*/
    private Integer registyCenterPort;

    /**
     * 客户端与服务端保持连接数
     */
    private int doveConnectionNum = 2;

    /**
     * 该时间内没有收到心跳，关闭客户端
     */
    private int doveIdeReadTimeOut = 10;


    /**
     * 管理连接线程数
     */
    private int bossThreadNum;
    /**
     * 工作线程数量
     */
    private int workerThreadNum;


    private String rpcPackages;

    public String getRpcPackages()
    {
        return rpcPackages;
    }

    public void setRpcPackages(String rpcPackages)
    {
        this.rpcPackages = rpcPackages == null ? null : "".equals(rpcPackages.trim()) ? null : rpcPackages.trim();
    }

    public String getRegistyCenterHost()
    {
        return registyCenterHost;
    }

    public void setRegistyCenterHost(String registyCenterHost)
    {
        this.registyCenterHost = registyCenterHost == null ?
                null :
                "".equals(registyCenterHost.trim()) ? null : registyCenterHost.trim();
    }

    public Integer getRegistyCenterPort()
    {
        return registyCenterPort;
    }

    public void setRegistyCenterPort(Integer registyCenterPort)
    {
        this.registyCenterPort = registyCenterPort;
    }

    public int getDoveConnectionNum()
    {
        return doveConnectionNum;
    }

    public void setDoveConnectionNum(int doveConnectionNum)
    {
        this.doveConnectionNum = doveConnectionNum;
    }

    public int getDoveIdeReadTimeOut()
    {
        return doveIdeReadTimeOut;
    }

    public void setDoveIdeReadTimeOut(int doveIdeReadTimeOut)
    {
        this.doveIdeReadTimeOut = doveIdeReadTimeOut;
    }

    public int getBossThreadNum()
    {
        return bossThreadNum;
    }

    public void setBossThreadNum(int bossThreadNum)
    {
        this.bossThreadNum = bossThreadNum;
    }

    public int getWorkerThreadNum()
    {
        return workerThreadNum;
    }

    public void setWorkerThreadNum(int workerThreadNum)
    {
        this.workerThreadNum = workerThreadNum;
    }

}
